package com.lm.controller;

import com.lm.pojo.Docter;
import com.lm.pojo.LoginBean;
import com.lm.service.LoginService;
import com.lm.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @version 1.0
 * @dscription:TODO
 * @author32477
 * @date 2025/9/26 15:33
 */
@CrossOrigin
@Api(tags = "登录管理")
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private LoginService loginService;


    @ApiOperation(value="医生登录", notes = "医生登录",httpMethod = "POST")
    @PostMapping("/docterLogin")
    public ResultUtil<HashMap<String,Object>> docterLogin(@RequestBody LoginBean loginBean){
        try{
            return new ResultUtil<>(200,"success",loginService.docterLogin(loginBean));
        }catch (Exception e){
            return new ResultUtil<>(500,"登录失败");
        }
    }



}
